package operator;

/**
 * @author yuisama
 * @date 2022/08/17 11:35
 * 三目运算符
 **/
public class ConditionOperation {
    public static void main(String[] args) {
//        int a = 10;
//        int b = 20;
//        // 想求a和b的最大值然后赋值给变量max
//        int max = a > b ? a : b;
//        System.out.println(max);
//        int a = 10;
//        int b = 20;
//        double c = a < b ? 1 : 2.0;
//        System.out.println(a < b ? 1 : 2.0);
        int a = 10;
        int b = 20;
        int avg = a + ((b - a) >> 1);
        System.out.println(avg);
    }
}